package com.gwt.shared;

import java.util.List;

import com.google.gwt.requestfactory.shared.InstanceRequest;
import com.google.gwt.requestfactory.shared.LoggingRequest;
import com.google.gwt.requestfactory.shared.Request;
import com.google.gwt.requestfactory.shared.RequestContext;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.Service;
import com.gwt.server.BeerListService;
import com.gwt.server.domain.Beer;
import com.gwt.server.domain.BeerStyle;

/**
 * Request factory for the DynaTable sample. Instantiate via
 * {@link com.google.gwt.core.client.GWT#create}.
 */
public interface BeerTableRequestFactory extends RequestFactory {

	/**
	 * Source of request objects for the Address class.
	 */
	@Service(BeerStyle.class)
	interface BeerStyleRequest extends RequestContext {
		InstanceRequest<BeerStyleProxy, Void> persist();
	}

	/**
	 * Source of request objects for the Person class.
	 */
	@Service(Beer.class)
	interface BeerRequest extends RequestContext {
		InstanceRequest<BeerProxy, Void> persist();
	}

	/**
	 * Source of request objects for the SchoolCalendarService.
	 */
	@Service(BeerListService.class)
	interface BeerListRequest extends RequestContext {

		Request<List<BeerProxy>> getBeerList(int startIndex, int maxCount);

		Request<BeerProxy> getRandomBeer();
	}

	BeerStyleRequest beerStyleRequest();

	LoggingRequest loggingRequest();

	BeerRequest beerRequest();

	BeerListRequest beerListRequest();
}
